3.58 \(\int \frac {\csc (e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=60 \[ -\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{a f \sqrt {a-b}}-\frac {\tanh ^{-1}(\cos (e+f x))}{a f} \]

[Out]

-arctanh(cos(f*x+e))/a/f-arctan(sec(f*x+e)*b^(1/2)/(a-b)^(1/2))*b^(1/2)/a/f/(a-b)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3664, 391, 207, 205} \[ -\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{a f \sqrt {a-b}}-\frac {\tanh ^{-1}(\cos (e+f x))}{a f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]/(a + b*Tan[e + f*x]^2),x]

[Out]

-((Sqrt[b]*ArcTan[(Sqrt[b]*Sec[e + f*x])/Sqrt[a - b]])/(a*Sqrt[a - b]*f)) - ArcTanh[Cos[e + f*x]]/(a*f)

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 391

Int[1/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x^n),
 x], x] - Dist[d/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0]

Rule 3664

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[((-1 + ff^2*x^2)^((m - 1)/2)*(a - b + b*ff^2*x^2)^p)/x^(
m + 1), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {\csc (e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {1}{\left (-1+x^2\right ) \left (a-b+b x^2\right )} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{a f}-\frac {b \operatorname {Subst}\left (\int \frac {1}{a-b+b x^2} \, dx,x,\sec (e+f x)\right )}{a f}\\ &=-\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \sec (e+f x)}{\sqrt {a-b}}\right )}{a \sqrt {a-b} f}-\frac {\tanh ^{-1}(\cos (e+f x))}{a f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.24, size = 144, normalized size = 2.40 \[ \frac {\sqrt {b} \sqrt {a-b} \tan ^{-1}\left (\frac {\sqrt {a-b}-\sqrt {a} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {b}}\right )+\sqrt {b} \sqrt {a-b} \tan ^{-1}\left (\frac {\sqrt {a-b}+\sqrt {a} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {b}}\right )-(a-b) \left (\log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )}{a f (a-b)} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]/(a + b*Tan[e + f*x]^2),x]

[Out]

(Sqrt[a - b]*Sqrt[b]*ArcTan[(Sqrt[a - b] - Sqrt[a]*Tan[(e + f*x)/2])/Sqrt[b]] + Sqrt[a - b]*Sqrt[b]*ArcTan[(Sq
rt[a - b] + Sqrt[a]*Tan[(e + f*x)/2])/Sqrt[b]] - (a - b)*(Log[Cos[(e + f*x)/2]] - Log[Sin[(e + f*x)/2]]))/(a*(
a - b)*f)

________________________________________________________________________________________

fricas [A]  time = 0.54, size = 184, normalized size = 3.07 \[ \left [\frac {\sqrt {-\frac {b}{a - b}} \log \left (\frac {{\left (a - b\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (a - b\right )} \sqrt {-\frac {b}{a - b}} \cos \left (f x + e\right ) - b}{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + b}\right ) - \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, a f}, -\frac {2 \, \sqrt {\frac {b}{a - b}} \arctan \left (-\frac {{\left (a - b\right )} \sqrt {\frac {b}{a - b}} \cos \left (f x + e\right )}{b}\right ) + \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, a f}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(-b/(a - b))*log(((a - b)*cos(f*x + e)^2 + 2*(a - b)*sqrt(-b/(a - b))*cos(f*x + e) - b)/((a - b)*cos
(f*x + e)^2 + b)) - log(1/2*cos(f*x + e) + 1/2) + log(-1/2*cos(f*x + e) + 1/2))/(a*f), -1/2*(2*sqrt(b/(a - b))
*arctan(-(a - b)*sqrt(b/(a - b))*cos(f*x + e)/b) + log(1/2*cos(f*x + e) + 1/2) - log(-1/2*cos(f*x + e) + 1/2))
/(a*f)]

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*(1/4/a*ln(abs(1-cos(f*x+exp(1)))/abs(1+cos(f*x+exp(1))))-2
*b/a*1/4/sqrt(-b^2+a*b)*atan((-a*cos(f*x+exp(1))+b*cos(f*x+exp(1))+b)/(sqrt(-b^2+a*b)*cos(f*x+exp(1))+sqrt(-b^
2+a*b))))

________________________________________________________________________________________

maple [A]  time = 0.56, size = 75, normalized size = 1.25 \[ \frac {b \arctan \left (\frac {\left (a -b \right ) \cos \left (f x +e \right )}{\sqrt {\left (a -b \right ) b}}\right )}{f a \sqrt {\left (a -b \right ) b}}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 f a}-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 f a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)/(a+b*tan(f*x+e)^2),x)

[Out]

1/f/a*b/((a-b)*b)^(1/2)*arctan((a-b)*cos(f*x+e)/((a-b)*b)^(1/2))+1/2/f/a*ln(-1+cos(f*x+e))-1/2/f/a*ln(1+cos(f*
x+e))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for mor
e details)Is b-a positive or negative?

________________________________________________________________________________________

mupad [B]  time = 11.86, size = 91, normalized size = 1.52 \[ \frac {\ln \left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{a\,f}-\frac {\sqrt {b}\,\mathrm {atan}\left (\frac {b-a\,\cos \left (e+f\,x\right )+b\,\cos \left (e+f\,x\right )}{2\,\sqrt {b}\,{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\sqrt {a-b}}\right )}{a\,f\,\sqrt {a-b}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(e + f*x)*(a + b*tan(e + f*x)^2)),x)

[Out]

log(sin(e/2 + (f*x)/2)/cos(e/2 + (f*x)/2))/(a*f) - (b^(1/2)*atan((b - a*cos(e + f*x) + b*cos(e + f*x))/(2*b^(1
/2)*cos(e/2 + (f*x)/2)^2*(a - b)^(1/2))))/(a*f*(a - b)^(1/2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\csc {\left (e + f x \right )}}{a + b \tan ^{2}{\left (e + f x \right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*tan(f*x+e)**2),x)

[Out]

Integral(csc(e + f*x)/(a + b*tan(e + f*x)**2), x)

________________________________________________________________________________________